﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SSN.Objects;
using SSN.WebFramework.Logging;

namespace SSN.WebFramework
{
    public static class ErrorManager
    {

        /// <summary>
        /// The url of the page representing a NotAuthorized error.
        /// </summary>
        public static string NotAuthorizedPage { get { return WebSettings.NotAuthorizedPage; } }

        /// <summary>
        /// The url of the page representing a general error;
        /// </summary>
        public static string ErrorPage { get { return WebSettings.ErrorPage; } }


        ///TODO: Flesh out error handling.
        /// <summary>
        /// Redirects the current request to an error page.
        /// </summary>
        /// <param name="page"></param>
        /// <param name="message"></param>
        public static void HandleError(GenPage page, string message)
        {
            page.Response.Redirect(ErrorManager.ErrorPage);
        }
    }
}
